
var JS_COMMON = function() {
};

JS_COMMON.showPopup = function(action,width,height,isScrolling,isCloseClick) {
	$.fancybox.open({
		maxWidth	: width,
		maxHeight	: height,
		autoSize	: false,
		fitToView   : false,
		closeClick  : true,
		openEffect  : 'none',
		closeEffect : 'none',
		overflow : 'hidden', 
		scrolling : 'no', // changes CSS property "overflow" for the "fancybox-inner" element
		iframe : {
		    scrolling : isScrolling, // changes "scrolling" for the iframe only
		    preload   : true
		},
		href :  action.indexOf('?') === -1 ?  action+'?isPopup=true': action+'&isPopup=true', // only one or multi param
		helpers    : { 
		    overlay: {closeClick: isCloseClick}
		    },
		    onUpdate    : function(){
		        this.height = ($('.fancybox-iframe').contents().find('html').height())+50;
		        $.fancybox.update();
		    },
		    beforeShow: function(){
		    	  // added 50px to avoid scrollbars inside fancybox
		    	  // this.width = ($('.fancybox-iframe').contents().find('html').width())+50;
		    	   this.height = ($('.fancybox-iframe').contents().find('html').height())+50;
		    	   //alert(this.height);
		    	   },
		type : 'iframe'
	});
}

	JS_COMMON.doLogout = function() {
	var dataString = {};
		$.ajax({
			dataType : 'json',
			type : 'POST',
			url : 'doLogout',
			data : dataString,
			complete : function(data) {
				
				if(data.status == 200){
					window.top.location.href ='cho';
					 
				}else{
					alert('dang nhap that bai');
				}
				
				
			}

		});
		return false;
}